package com.lifeng.zk.zkclient.watch;

import org.I0Itec.zkclient.ZkClient;

/**
 * Created by lifeng on 2018/6/14.
 */
public class WatcherTest {
    private static String serverUrl = "127.0.0.1:2181";
    public static void main(String[] args) throws Exception{
        ZkClient zkClient = new ZkClient(serverUrl);
        System.out.println("zkclient 链接成功");
        zkClient.subscribeChildChanges("/config", new MyChildWatcher());
        zkClient.subscribeDataChanges("/config",new MyDataWatcher());
        zkClient.subscribeStateChanges(new MyStateWatcher());
        Thread.sleep(100000000);
    }
}
